<?php
require_once("config.php");
require_once("alipay/AopSdk.php");
if (!empty($_GET['WIDout_trade_no']) && trim($_GET['WIDout_trade_no']) != "" && !strpos($_SERVER['HTTP_USER_AGENT'], 'MicroMessenger')) {
$data = array(
			'product_code'=>'FAST_INSTANT_TRADE_PAY',
			'out_trade_no'=>$_GET['WIDout_trade_no'],
			//'subject'=>'test',//$_GET['subject'],
			'subject'=>'electronic product',
			'total_amount'=>$_GET['WIDtotal_amount'],
			//'body'=>'test'//$_GET['body']
			'body'=>'electronic product'
		);
$data = json_encode($data);		
//构造参数  
$aop = new AopClient ();  
$aop->gatewayUrl = $config['gatewayUrl'];  
$aop->appId = $config['app_id'];  
$aop->rsaPrivateKey = $config['merchant_private_key'];  
$aop->apiVersion = '1.0';  
$aop->signType = $config['sign_type'];  
$aop->postCharset= $config['charset'];  
$aop->format='json';  
$request = new AlipayTradePagePayRequest ();  
$request->setReturnUrl($config['return_url']);  
$request->setNotifyUrl($config['notify_url']);
$request->setBizContent($data);

//请求  
$result = $aop->pageExecute ($request);

//输出  
echo $result;
}
?>


<!DOCTYPE html>
<html>
    <head>
        <title>
          
        </title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta name="viewport" content="width=device-width">
        <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
        <style>
            *{
                margin:0;
                padding:0;
            }
            ul,ol{
                list-style:none;
            }
            body{
                font-family: "Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif;
            }
            .hidden{
                display:none;
            }
            .new-btn-login-sp{
                padding: 1px;
                display: inline-block;
                width: 75%;
            }
            .new-btn-login {
                background-color: #02aaf1;
                color: #FFFFFF;
                font-weight: bold;
                border: none;
                width: 100%;
                height: 30px;
                border-radius: 5px;
                font-size: 16px;
            }
            #main{
                width:100%;
                margin:0 auto;
                font-size:14px;
            }
            .red-star{
                color:#f00;
                width:10px;
                display:inline-block;
            }
            .null-star{
                color:#fff;
            }
            .content{
                margin-top:5px;
            }
            .content dt{
                width:100px;
                display:inline-block;
                float: left;
                margin-left: 20px;
                color: #666;
                font-size: 13px;
                margin-top: 8px;
            }
            .content dd{
                margin-left:120px;
                margin-bottom:5px;
            }
            .content dd input {
                width: 85%;
                height: 28px;
                border: 0;
                -webkit-border-radius: 0;
                -webkit-appearance: none;
            }
            #foot{
                margin-top:10px;
                position: absolute;
                bottom: 15px;
                width: 100%;
            }
            .foot-ul{
                width: 100%;
            }
            .foot-ul li {
                width: 100%;
                text-align:center;
                color: #666;
            }
            .note-help {
                color: #999999;
                font-size: 12px;
                line-height: 130%;
                margin-top: 5px;
                width: 100%;
                display: block;
            }
            #btn-dd{
                margin: 20px;
                text-align: center;
            }
            .foot-ul{
                width: 100%;
            }
            .one_line{
                display: block;
                height: 1px;
                border: 0;
                border-top: 1px solid #eeeeee;
                width: 100%;
                margin-left: 20px;
            }
            .am-header {
                display: -webkit-box;
                display: -ms-flexbox;
                display: box;
                width: 100%;
                position: relative;
                padding: 7px 0;
                -webkit-box-sizing: border-box;
                -ms-box-sizing: border-box;
                box-sizing: border-box;
                background: #1D222D;
                height: 50px;
                text-align: center;
                -webkit-box-pack: center;
                -ms-flex-pack: center;
                box-pack: center;
                -webkit-box-align: center;
                -ms-flex-align: center;
                box-align: center;
            }
            .am-header h1 {
                -webkit-box-flex: 1;
                -ms-flex: 1;
                box-flex: 1;
                line-height: 18px;
                text-align: center;
                font-size: 18px;
                font-weight: 300;
                color: #fff;
            }
        </style>
    </head>
    <body text=#000000 bgColor="#ffffff" leftMargin=0 topMargin=4>
        <header class="am-header">
            <h1>支付宝支付</h1>
        </header>
       
        <div id="main">
            <form name=alipayment action='' method=get target="_blank">
                <div id="body" style="clear:left">
                    <dl class="content">
                        <dt>商户订单号
                            ：</dt>
                        <dd>
                            <input id="WIDout_trade_no" name="WIDout_trade_no" value="<?php echo $_GET["orderid"] ?>" readonly="readonly">
                        </dd>
                        <hr class="one_line">
                        <dt>订单名称
                            ：</dt>
                        <dd>
                            <input id="WIDsubject" name="WIDsubject" value="drinker" readonly="readonly">
                        </dd>
                        <hr class="one_line">
                        <dt>付款金额
                            ：</dt>
                        <dd>
                            <input id="WIDtotal_amount" name="WIDtotal_amount" value="<?php echo $_GET["total_fee"] ?>" readonly="readonly">
                        </dd>
                        <hr class="one_line">
                        <dt>商品描述：</dt>
                        <dd>
                            <input id="WIDbody" name="WIDbody" value="drinker" readonly="readonly">
                        </dd>
                        <hr class="one_line">
                        	 <!--
                         <dt>特别提示：</dt>
                          <dd>
                            <input id="tipsid1" name="tips1" value="本次交易由国民云计费提供支持" readonly="readonly">
                        </dd>
                            <hr class="one_line">
                            
                         <dt></dt>
					
                          <dd>
                            <input id="tips2id" name="tips2" value="有疑问或需人充值咨询客服微信：QQY2226">
                        </dd>
						-->
                            <hr class="one_line">
                        <dt></dt>
                        <dd id="btn-dd">
                            <span class="new-btn-login-sp">
                                <button class="new-btn-login" type="submit" style="text-align:center;">继续支付</button>
                            </span>

                        </dd>
                    </dl>
                </div>
            </form>
            <div id="foot">
                <ul class="foot-ul">
                    <li>

                    </li>
                </ul>
            </div>
        </div>


    </body>
  